







public class MyReader {
	public MyReader(){
		
	}
	public MyReader(String string){
		this.string = string;
	}
	
	public MyReader(String string,int time){
		this.string=string;
		this.time=time;
	}
	public MyReader(String string,int time,int rate){
		this.string=string;
		this.time=time;
		this.rate=rate;
	}
	
	private smartreadjava reader = new smartreadjava();
	
	//private String string = "各监控人员请注意：本次监控参与人员如下；   大屏控制台，  张三：  一号监控台，  吕强：  二号监控台， 李超：  三号监控台，  李宝生：    四号监控台，  李晓雨；  监控过程中有答题任务：回答正确可以奖励金币；现在监控开始：请各监控台开始监控。";
	private String string=" ";
	
	private int rate=58;
	private int volume=100;
	private Thread thread;
	private int time = 29000;
	
	public   void read(String string,int time,int rate){
		this.string=string;
		this.time=time;
		this.rate=rate;
		thread = new Thread(new play(string,time,rate));
		thread.start();
			
	
	}

	public   void read(String string,int time){
		this.string=string;
		this.time=time;
		thread = new Thread(new play(string,time,rate));
		thread.start();
			
	
	}
	
	public   void read(){
		
		thread = new Thread(new play(string,time,rate));
		thread.start();
			
	
	}
	
	private class play implements Runnable {
		public play(String str,int time,int rate){
			string = str;
		}
		private String string= " " ;
		public String getString() {
			return string;
		}
		public void setString(String string) {
			this.string = string;
		}
		public  void  run() {
			if(!" ".equals(string)){
			synchronized(MyReader.class){
			System.out.println("run start");
//			reader.SmartRead_SetSpeed(50);
//			System.out.println("run 1");
//			reader.SmartRead_SetVolume(50);
			System.out.println("run 2");
			reader.SmartRead_InitialAuth(0, 0, 0, 0, "support@smartysoft.com",
					"88888888", "111-111-111-111");
			System.out.println("run 3");
			reader.SmartRead_SetMode(0);
			System.out.println("run 4");
			
			reader
					.SmartRead_Speak(string, "   ", 1, 13, rate, volume, 0, -1,
							"");
			System.out.println("run 5");
			
			System.out.println("run end");
			try {
				Thread.sleep(time);
				//this.wait();
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			reader.SmartRead_Close();
			System.out.println("run end2");
			//while(true){}
			//this.notify();
			}
			}
			
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
//		new Thread(new Runnable() {
//			
//			@Override
//			public void run() {
//				// TODO Auto-generated method stub
//				System.out.println("�߳̿�ʼ");
//				String string = "asdfdsfԤ������ʼ��������۲���ͼ�β���ʱ�����ֺ�Ԥ����";
//				int rate=75;
//				int volume=100;
//				smartreadjava reader = new smartreadjava();
//				reader.SmartRead_InitialAuth(0, 0, 0, 0, "support@smartysoft.com",
//						"88888888", "111-111-111-111");
//				reader.SmartRead_SetMode(0);
//				reader.SmartRead_Speak(string, "   ", 1, 0, rate, volume, 0, -1,
//								"");
//				reader.SmartRead_Close();
//				System.out.println("�߳̽���");
//			}
//		}).start();
		MyReader r =new MyReader("sdfsdfsdfsf",5000);
		for(int i=0;i<1;i++){
		r.read();
		}
//		
//		while(true){
//			
//		}
		
//		while((1<2)){
//		
//		}


	}

}
